Across the embedded and non-embedded CPU market, one finds predominant Instruction Set Architectures (ISAs) for which large bodies of software exist that could be “accelerated” for performance, or “translated” to a myriad of capable processors that could present better cost/performance benefits, provided they could transparently access the relevant software. One also finds dominant CPU architectures that are locked in time to their ISA, and cannot evolve in performance or market reach and would benefit from “synthetic CPU” co-architecture.
It is often desired to run program code written for a computer processor of a first type (a “subject” processor) on a processor of a second type (a “target” processor). Here, an emulator or translator is used to perform program code conversion, such that the subject program is able to run on the target processor. PCT application WO00/22521 discloses program code conversion methods and apparatus to facilitate such acceleration, translation and co-architecture capabilities as may be employed in embodiments of the present invention.
In certain operating systems, including in particular Unix-like operating systems, a process filesystem is provided. The process file system can be used by a process to access information about other processes, and about the hardware environment provided by the processor. For example, the Solaris operating system from Sun Microsystems Inc. provides a process filesystem comprising a virtual filesystem in a directory known as /proc. The contents of and structure of /proc are built dynamically by the operating system as processes are run, with typically one sub-directory created and maintained per live process.
The provision of a process filesystem as described above can complicate program code conversion. There are three ways in which this is evident. Firstly, if the target operating system does not provide a process filesystem, but the subject code refers to one then there is inherent incompatibility.
Secondly, if the target operating system does provide a process filesystem, its arrangement and operation may still be incompatible with the process filesystem referred to by the subject code.
Thirdly, if the target operating system does provide a compatible process filesystem it may be difficult to distinguish translator processes from other processes in the target process filesystem.
One option to allow integration of information relating to subject processes into a target operating system's process filesystem is to modify the target processor's operating system. Modification of the target operating system can change the way the target process filesystem is constructed and administered, and may be achieved by building a kernel module and inserting this into the target operating system, or by direct source code modification of the target operating system. However, modification of the target operating system may be a difficult task, and may destabilise the target operating system.
A method of administering a process filesystem with respect to translation of subject program code is provided, such as for example when the translator is part of computer system as described herein. A translator operatable to convert subject code to target code can be arranged such that references in the subject program to the subject process filesystem are identified, and target code generated. The generated target code enables the translator to reference and provide process information in a way which is consistent with the expected behaviour of the subject processor, improving the operation of a computer system on which the translator is operating.
Preferred embodiments of the present invention enable subject process information to be administered conveniently by the translator, without modification of the target operating system. This avoids destabilising the target operating system, and allows the translator to deal correctly with the behaviour of potentially unstable subject processes during translation.
The present invention may thereby improve performance of a computer system, for example while that system is undertaking program code conversion.